//
//  ArqKey.h
//  arq
//
//  Created by xiao wen on 15/1/20.
//  Copyright (c) 2015年 witsi. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "DataTransmitImp.h"

@interface ArqKey : NSObject{
@private
    void *pCppObj;
}


- (id)initWith:(DataTransmitImp*)dataTransmit;

/* parameter:
 * keyval ---- return the key value
 * ms ----- time out in ms
 * return:
 * = 0: success
 * -1: io error happened.
 * -2: bad argument.
 * -3: get key failed.
 * -4: get key timeout.
 * -5: unknown error!
 */
-(int)getKey:(Byte*)keyval inTimeInterval:(int)ms;

/*
 * parameter:
 * x  ---- x coordinate to display string in LCD
 * y ----- y coordinate to display string in LCD
 * minlen ---- min length of string
 * maxlen ----max length of string
 * dis ------character to dispaly
 *              		0x00 --- display original value
 *      			others --- use this value
 * mode ----- quit mode:
 *            		0x00 --- press Enter to EXIT
 *        			0x01 --- direct EXIT
 * ms ------ timeout(unit: ms)
 * keystr ------ buffer use to return key string.
 * return:
 * >=0: key string length.
 * -1: io error happened.
 * -2: bad argument.
 * -3: get key failed.
 * -4: get key timeout.
 * -5: user press esc to quit.
 * -6: unknown error!
 */
-(int)getAsciiStrNWriteAtX:(int)x Y:(int)y minLen:(int)minlen maxLen:(int)maxlen display:(int)dis mode:(int)mode inTimeInterval:(int)ms returnKeyValues:(NSData**)keys;

/*
 * parameter:
 * x  ---- x coordinate to display money in LCD
 * y  ---- y coordinate to display money in LCD
 * ms --- timeout(unit: ms)
 * buf --- buffer use to return data.
 * return:
 * =0: success.
 * -1: io error happened.
 * -2: bad argument.
 * -3: get key failed.
 * -4: get key timeout.
 * -5: user press esc to quit.
 * -6: unknown error!
 */
-(int)getTransAmountAtX:(int)x Y:(int)y inTimeInterval:(int)ms returnKeyValues:(NSData**)keys;

@end

//class ArqKey
//{
//public:
//    int getKey(byte[] keyval, int ms);
//    int getAsciiStr(int x, int y, int minlen, int maxlen,
//                    int dis, int mode, int ms, byte[] keystr);
//    int getTransAmount(int x, int y, int ms, byte[] buf);
//    
//};
